﻿using System;
using SQLite.Net.Interop;

namespace Cashbook.Droid
{
    public class Config : IConfig
    {
		private string directorioDB;

		private ISQLitePlatform plataforma;


		public string DirectorioDB
		{
			get
			{
				if (string.IsNullOrEmpty(directorioDB))
				{
					//var dbName = "Members.sqlite";
					//var dbPath = System.Environment.GetFolderPath(System.Environment.SpecialFolder.ApplicationData);
					//var path = System.IO.Path.Combine(dbPath, dbName);
					//var conn = new SQLite.SQLiteConnection(path);

                    directorioDB = System.Environment.GetFolderPath(Environment.SpecialFolder.Personal);
					
				}
				return directorioDB;
			}
		}

		public ISQLitePlatform Plataforma
		{
			get
			{
				if (plataforma == null)
				{
                    plataforma = new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid();
				}
				return plataforma;
			}
		}
    }
}
